#include "StdAfx.h"
#include "DxVertexShader.h"
#include "D3DX9Shader.h"
#include "DxRenderer.h"
#include "Utility\Matrix.h"


DxVertexShader::DxVertexShader(void)
{
	m_pVertexShader = 0;
}


DxVertexShader::~DxVertexShader(void)
{
	m_pVertexShader->Release();
}


bool DxVertexShader::LoadFromFile(char* szPath, DxRenderer* renderer)
{
	char* shader = LoadShaderData(szPath);

	if( shader )
	{
		HRESULT result = renderer->GetDevice()->CreateVertexShader((DWORD*)shader, &m_pVertexShader);
		delete shader;
		return true;
	}

	return false;

}